package tv.acgn.advertisement.index.po;

import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * @program: advertisement-ad-publish-po
 * @description: 用户模型 持久化类
 * @author: junG
 * @create: 2019-04-29 17:14
 **/

@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "ad_user")
@Entity
@DynamicInsert
@DynamicUpdate
public class AdUserPO {

    @Id
    @Column(name = "user_id", nullable = false, unique = true, length = 64)
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    private String userId;

    @Column(name = "user_name", nullable = false)
    private String userName;

    @Column(name = "token", nullable = false)
    private String token;

    /**
     * 用户状态
     */
    @Column(name = "user_status", nullable = false)
    private Integer userStatus;

    @Column(name = "create_time", nullable = false)
    private LocalDateTime createTime;

    @Column(name = "update_time", nullable = false)
    private LocalDateTime updateTime;
}
